﻿using ALEXBlog.Entity;
using ALEXBlog.Entity.ViewModel;
using AutoMapper;

namespace ALEXBlog.Extensions.AutoMapper
{
    public class AutoMapperConfigProfile : Profile
    {
        public AutoMapperConfigProfile()
        {
            //不映射某个字段的写法
            //CreateMap<Model, ViewModel>().ForMember(x=>x.Introduction,o=>o.Ignore());

            //强关联某个字段的写法
            //CreateMap<Model, ViewModel>().ForMember(x=>x.Name,o=>o.MapFrom(a=>a.Name));

            #region 配置映射
            CreateMap<UsersModel, UsersVM>();

            #endregion
        }
    }
}
